package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TravelInfoPoi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TravelInfoPoiMapper;
import com.ruoyi.system.service.ITravelInfoPoiService;
import com.ruoyi.common.core.text.Convert;

/**
 * 行程兴趣点Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-17
 */
@Service
public class TravelInfoPoiServiceImpl implements ITravelInfoPoiService
{
    @Autowired
    private TravelInfoPoiMapper TravelInfoPoiMapper;

    /**
     * 查询行程兴趣点
     *
     * @param id 行程兴趣点主键
     * @return 行程兴趣点
     */
    @Override
    public TravelInfoPoi selectTravelInfoPoiById(Long id)
    {
        return TravelInfoPoiMapper.selectTravelInfoPoiById(id);
    }

    /**
     * 查询行程兴趣点列表
     *
     * @param travelInfoPoi 行程兴趣点
     * @return 行程兴趣点
     */
    @Override
    public List<TravelInfoPoi> selectTravelInfoPoiList(TravelInfoPoi travelInfoPoi)
    {
        return TravelInfoPoiMapper.selectTravelInfoPoiList(travelInfoPoi);
    }

    /**
     * 新增行程兴趣点
     *
     * @param travelInfoPoi 行程兴趣点
     * @return 结果
     */
    @Override
    public int insertTravelInfoPoi(TravelInfoPoi travelInfoPoi)
    {
        travelInfoPoi.setCreateTime(DateUtils.getNowDate());
        return TravelInfoPoiMapper.insertTravelInfoPoi(travelInfoPoi);
    }

    /**
     * 修改行程兴趣点
     *
     * @param travelInfoPoi 行程兴趣点
     * @return 结果
     */
    @Override
    public int updateTravelInfoPoi(TravelInfoPoi travelInfoPoi)
    {
        travelInfoPoi.setUpdateTime(DateUtils.getNowDate());
        return TravelInfoPoiMapper.updateTravelInfoPoi(travelInfoPoi);
    }

    /**
     * 批量删除行程兴趣点
     *
     * @param ids 需要删除的行程兴趣点主键
     * @return 结果
     */
    @Override
    public int deleteTravelInfoPoiByIds(String ids)
    {
        return TravelInfoPoiMapper.deleteTravelInfoPoiByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除行程兴趣点信息
     *
     * @param id 行程兴趣点主键
     * @return 结果
     */
    @Override
    public int deleteTravelInfoPoiById(Long id)
    {
        return TravelInfoPoiMapper.deleteTravelInfoPoiById(id);
    }
}
